package com.Cychat.post.mapper;

import com.Cychat.commons.entity.pojo.MessageReminding;
import com.Cychat.post.entity.dto.RemindingDTO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MessageRemindingMapper extends BaseMapper<MessageReminding> {
    @Select("SELECT m.message_id,m.post_id,u.nick_name,u.avatar_url,m.content,m.is_read,m.send_time FROM message_reminding m " +
            "JOIN user u ON m.sender_id = u.user_id WHERE receiver_id = #{receiverId} ORDER BY send_time DESC" )
    List<RemindingDTO> getMessageRemindingByreceiverId(Long receiverId);
}
